Loading application onto Raspberry Pi

Starting Neuron Power Engineer

Condition for an extended version of Neuron Power Engineer: You have already installed the required license.

  1. Go to the folder where you installed Neuron Power Engineer.

  2. Locate the file NeuronPowerEngineer.exe to start Neuron Power Engineer and double-click it.

  3. If you have installed one version of Neuron Power Engineer only on your system, select the default workspace and click OK in the dialog.
    (warning) Mind the guidelines/recommendations for a workspace. Moreover, consider the guidelines/recommendations for projects that you are going to create in Neuron Power Engineer. See "Starting the development environment and the runtime environment" for those guidelines/recommendations.

  4. Only required at the first start of Neuron Power Engineer:

    • Accept the conditions of the license agreement.

    • If Windows security alerts The Windows Firewall has blocked some features of this program appear, click Allow access. Alternative: Contact your system administrator and ask him to define rules for the Windows firewall.

Creating project for Raspberry Pi

  1. In menu File or from the context menu within the project explorer, select New and Project...

  2. In the dialog, expand Neuron Power Engineer Sample Projects for Raspberry Pi, select the project template Turn LEDs on/off (PiFace required) and click Next >.
    If you are interested in a more complex control of the LEDs on the PiFace, you might want to use the project template Moving light (PiFace required).

  3. On the next page, enter or select the project name, uncheck Use default location and enter a location outside the workspace, then click Finish.

    No blanks or special characters in project name and location

    Make sure that there are no blanks or special characters (such as umlauts, e.g. ä, ö, ü) in a project name and in the installation path. If anyway, Neuron Power Engineer will not be able to load the application onto the PLC.
    For the paths and project names, letters A – Z or a – z, numbers 0 – 9, dots (character .), underlines (character _) and dashes (character -) are allowed. Examples for allowed project names: my.projectmy-project, my_Project_01

    Result: The project is displayed within the project explorer. The existing ST-object program (in folder src) already contains a sample application for the Raspberry Pi. The existing PLC-object raspberry contains a specification for IO_IMPORT that is required for accessing the hardware IOs of the PiFace.

Entering the IP-address of Raspberry Pi within PLC-object

The existing PLC-object for the Raspberry Pi  is raspberry.

  1. Open the corresponding PLC-object.

  2. In the opened editor for the PLC-object, search for ADDRESS and enter the IP-address of your PLC.

    Given address
    ADDRESS := 0.1.1.1;
    Example: IP-address of your PLC
    ADDRESS := 192.168.1.225;
  3. Save the PLC-object.

Loading application onto Raspberry Pi and testing

The following results and steps on the PiFace are valid for those projects that are based on the project template Turn LEDs on/off (PiFace required).
If you have used the project template Moving light (PiFace required), see the existing ST-object program (in folder src) for the effects on the PiFace – it contains sufficient comments.

  1. Open the perspective Application Testing: menu WindowOpen Perspective and Application Testing

  2. Load the program onto the Raspberry Pi: In the Instance view, select RaspbianConfiguration\raspberry. First click  and then .
    Result: After the application has been loaded, the lamp LED2 is turned on.

  3. Perform the following steps on the Raspberry Pi:

    1. Press the push button S1 resp. S2 down. Result: The lamp LED0 resp. LED1 is turned on.

    2. Now release the push button of the PiFace. Result: The lamp is turned off.

  4. In Neuron Power Engineer: Monitor the values of the already inserted variables in the Values of Variables view, while you are pressing the push button down and then you are releasing them. Result: The values for the corresponding variables are changing.

  5. Change the value for the variable LED02 from TRUE to FALSE (and vice versa). Result: The lamp LED2 of the PiFace is turned off (and on).

Make sure that there is a constant power supply of the PLC for some time after the application has been loaded.

Reason: The synchronizing on the PLC harddisk might be started with a delay after the application has been loaded. Consequence: If there is a power cycle (i.e., the PLC is switched off and on again) immediately after the application has been loaded, the loaded application might be lost and you have to load the application onto the PLC again.

Alternative: Configure Neuron RTS max so that the harddisk of the target system is synchronized at once after the application is loaded (details: "A power cycle on a target system Pi causes the loss of the loaded application").

These steps conclude the tutorial to put a →Raspberry Pi into operation.

 


Interested in details? See the following articles: